package com.yuanhua.xcxmng.wechat.config;

import com.yuanhua.xcxmng.wechat.security.RequestOncePerFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hzy24985
 * @version $Id: FilterConfig, v 0.1 2018/8/6 下午5:24 hzy24985 Exp $
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean myOncePerRequestFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new RequestOncePerFilter());
        registration.addUrlPatterns("/*");
        registration.setName("RequestOncePerFilter");
        registration.setOrder(2);
        return registration;
    }
}
